
from . import config as config_module                               # 导入配置模块中的全局变量
from ascript.android.screen import FindImages                       # 导入FindImages类

from ascript.android.system import R                                #  导入上下文环境包,方便导入图片地址

from .lanying_HID import BlueHid                                    # 导入已加载的蓝影键鼠模块
from .Android_intent import *                                       # 导入Android_intent模块

# 导入模块
from .Personal_Information import get_personal_info                 # 导入个人信息获取控模块
from .strangers_handle import handle_stranger_message               # 导入陌生人消息处理模块
from .message_handle import process_unread_xiaohongshu_messages     # 导入常规消息处理模块
from .send_message_handle import handle_feishu_task                 # 导入消息发送模块

# from .Dialogue_collection import *                                 # 导入对话收集模块

from .feishu_api import modify_Feishu_data                          # 导入飞书API日志模块   

def cs():

    # 直接使用模块的变量
    
    print(f"导入的 coze_token: {config_module.coze_token}")
    print(f"导入的 expert_workflow_id: {config_module.expert_workflow_id}")
    print(f"导入的 adddata_workflow_id: {config_module.adddata_workflow_id}")
    print(f"导入的 querydata_workflow_id: {config_module.querydata_workflow_id}")
    print(f"导入的 modifydata_workflow_id: {config_module.modifydata_workflow_id}")
    print(f"导入的 expert_app_token: {config_module.expert_app_token}")
    print(f"导入的 log_app_token: {config_module.log_app_token}")
    print(f"导入的 my_name: {config_module.my_name}")
    print(f"导入的 my_id: {config_module.my_id}")



    modify_Feishu_data(
        config_module.coze_token, 
        config_module.adddata_workflow_id, 
        config_module.log_app_token, 
        "测试标题", 
        "测试内容/n -测试换行", 
        "选项 1"
    )

    #-----------------------------------------------------------------------------------------------------------------
    # 测试获取个人信息
    #-----------------------------------------------------------------------------------------------------------------
    # my_name, my_id = get_personal_info()

    # print(f"用户名：{my_name}，ID：{my_id}")

    #-----------------------------------------------------------------------------------------------------------------
    # 测试常规未读消息的调用
    #-----------------------------------------------------------------------------------------------------------------
    # WORKFLOW_ID = "7501351125795913779"
    # APP_TOKEN = "https://r6zjniadzx.feishu.cn/base/BZdKbYdj1aj7pSsjusrcXgzynCj?table=tblT3I79s6LGtdWA&view=vewj1oPAjo"
    # ACCESS_TOKEN = "pat_RCzUP9zVHVIY3lmsYGzDwlvEBAbc2grWa4AjZtnHg7pHetKMMnTX3mvbF4nOneDl"
    # MY_ID = "小红书号：26765622619"
    # MY_NAME = "一个达不溜哈"
    # max_process_cycles=3
    #
    # process_unread_xiaohongshu_messages(WORKFLOW_ID, APP_TOKEN, ACCESS_TOKEN, MY_ID, MY_NAME, max_process_cycles)

    #-----------------------------------------------------------------------------------------------------------------
    # 测试陌生人消息
    #-----------------------------------------------------------------------------------------------------------------
    # number = 3
    # workflow_id = "7501351125795913779"
    # app_token = "https://r6zjniadzx.feishu.cn/base/BZdKbYdj1aj7pSsjusrcXgzynCj?table=tblT3I79s6LGtdWA&view=vewj1oPAjo"
    # ACCESS_TOKEN = "pat_RCzUP9zVHVIY3lmsYGzDwlvEBAbc2grWa4AjZtnHg7pHetKMMnTX3mvbF4nOneDl"
    # my_id = "小红书号：26765622619"
    # my_name = "一个达不溜哈"
    # handle_stranger_message(number, workflow_id, app_token, ACCESS_TOKEN, my_id, my_name)

    #-----------------------------------------------------------------------------------------------------------------
    # 测试处理飞书任务
    #-----------------------------------------------------------------------------------------------------------------
    # ACCESS_TOKEN = "pat_RCzUP9zVHVIY3lmsYGzDwlvEBAbc2grWa4AjZtnHg7pHetKMMnTX3mvbF4nOneDl"
    # querydata_workflow_id = "7503931766982901794"
    # modifydata_workflow_id = "7504274822769492009"
    # app_token = "https://r6zjniadzx.feishu.cn/base/BZdKbYdj1aj7pSsjusrcXgzynCj?table=tblT3I79s6LGtdWA&view=vewj1oPAjo"
    # my_id = "小红书号：26765622619"
    # handle_feishu_task(ACCESS_TOKEN, querydata_workflow_id, modifydata_workflow_id, app_token, my_id)






if __name__ == "__main__":
    cs()
